package MULE.Sensorenmodul;

import MULE.Sensorenmodul.util.SensorParameter;
import lejos.nxt.LightSensor;
import lejos.nxt.SensorPort;

public class Light {
	LightSensor light = new LightSensor(SensorPort.S1);
	
	public Light(SensorParameter sensorParams){
		this.init(sensorParams);
	}
	
	private void init(SensorParameter sensorParams){
		/**
	try{
			
		if(sensorParams.getLightId() == 2){
			light = new LightSensor(SensorPort.S2);
		} else if(sensorParams.getLightId() == 3){
			light = new LightSensor(SensorPort.S3);
		} if(sensorParams.getLightId() == 4){
			light = new LightSensor(SensorPort.S4);
		}
	} catch (NullPointerException e) {
		System.out.println("NullPointerException: Light.init");
	}
	**/
	}
	
	public double getValue(){
		return light.readValue();
	}
	
	public void setFloodlight(boolean floodlight){
		this.light.setFloodlight(floodlight);
	}
	
}
